var form, $,areaData;
layui.use(['form','layer','upload','laydate'],function(){
    form = layui.form;
    $ = layui.jquery;
    var layer = parent.layer === undefined ? layui.layer : parent.layer,
        upload = layui.upload,
        laydate = layui.laydate

    //提交个人资料
    form.on("submit(addGroup)",function(data){
        //将填写的用户信息存到session以便下次调取
        var userIds = [];
        $("input:checkbox[name='userId']:checked").each(function(i){
            userIds.push($(this).val());
        });
        var index = layer.msg('创建中，请稍候',{icon: 16,time:false,shade:0.8});
        $.post("/group/addGroupFriend",{
            userIds:userIds,
            groupId:$("#groupId").val()
        },function(res){
            layer.msg(res);
        })
        setTimeout(function(){
            layer.close(index);
            layer.closeAll("iframe");
        },2000);
        return false;
    })
})